# from selenium import webdriver
# #初始化运行
# driver = webdriver.Chrome()
# driver.get('http://www.weather.com.cn/html/province/jiangsu.shtml')
# # driver.implicitly_wait()
# #获取所有城市天气
# tianqi=driver.find_element_by_id("forecastID")
# # print(tianqi.text)
#
# Weathertq = tianqi.text.split('℃\n')
# # print(Weathertq)
# # import time
# # time.sleep()
# lowest = 30#设置最低温度
# lowestCity = []  # 温度最低城市列表
#
# for one in Weathertq:
#     one = one.replace('℃','')
#     # print(one)
#
#     curcity = one.split('\n')[0]#获取所有城市
#     lowweather = one.split('/')[0].split('\n')[1]# 获取所有城市温度
#     lowweather= int(lowweather)
#     print(curcity)
#     print(lowweather)
#
#     if lowweather < lowest:
#         lowest = lowweather
#         lowestCity = [curcity]
#
#     elif lowweather == lowest:
#         lowestCity.append(curcity)
# #
# print('温度最低为%s℃, 城市有%s' % (lowest, ' '.join(lowestCity)))

#
# adderis=['\r\n                        光明区\r\n                        -\r\n                         公明\r\n                        -\r\n                     ', '\r\n          ']
# print([''.join([i.strip() for i in price.strip().split('\n')]) for price in adderis][0])
#
#
# adder=['\r\n                         宏发上域 (宏发上域花园)\r\n                     ']
# print([''.join([i.strip() for i in price.strip().split('\n')]) for price in adder][0])



import time
import datetime

def my_date(num):
    t = time.time()
    timeNow = datetime.datetime.now()
    t1 = datetime.date.today()
    # 传入1，返回秒级时间戳，10位
    if num == 1:
        timestamp = int(t)
        return timestamp
    # 传入2，返回毫秒级时间戳，13位
    elif num == 2:
        timestamp = int(round(t * 1000))
        return timestamp
    # 传入3，返回微秒级时间戳，16位
    elif num == 3:
        timestamp = int(round(t * 1000000))
        return timestamp
    # 传入4，返回3小时后时间，时分秒格式
    elif num == 4:
        timeUpdate = timeNow + datetime.timedelta(hours=3)
        t2 = timeUpdate.strftime('%Y-%m-%d %H:%M:%S')
        t3 = f"{t2}"
        return t3
    # 传入5，返回当前时间,时分秒格式
    elif num == 5:
        t2 = timeNow.strftime('%Y-%m-%d %H:%M:%S')
        return t2
    # 传入6，获取当前最大时间
    elif num == 6:
        today = "{}".format(t1)
        today_time = today + " " + "23:59:59"
        return today_time
    # 传入7，返回当天日期，年-月-日格式、
    elif num == 7:
        today = "{}".format(t1)
        return today
    # 传入8，返回当天日期，年/月/日格式、
    elif num == 8:
        today = timeNow.strftime("%Y/%m/%d")
        return today
    # 传入9，返回当天日期，年/月格式、
    elif num == 9:
        today = timeNow.strftime("%Y/%m")
        return today
    # 传入10，返回当天日期，月格式、
    elif num == 10:
        today = timeNow.strftime("%m")
        return today
       # 传入12，返回1天后时间，年/月/日格式
    elif num == 12:
        timeUpdate = timeNow + datetime.timedelta(days=1)
        t2 = timeUpdate.strftime('%Y-%m-%d')
        t3 = f"{t2}"
        return t3

print(my_date(1))
print(my_date(2))
print(my_date(3))
print(my_date(4))

timeNow = datetime.datetime.now()
print(timeNow)